﻿using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;

namespace TRIG_MOD_STATUSSUMMARY.IR_StatusSummary
{
    [ToolboxItemAttribute(false)]
    public class IR_StatusSummary : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        private const string _ascxPath = @"~/_CONTROLTEMPLATES/TRIG_MOD_STATUSSUMMARY/IR_StatusSummary/IR_StatusSummaryUserControl.ascx";

        protected string lstName;

        [WebBrowsable(true)]
        [WebDisplayName("TaskListName")]
        [WebDescription("To retrieve list item through Web part Tool Part property")]
        [Personalizable(PersonalizationScope.Shared)]
        [Category("List Item Configuration")]

        public string docTskLst
        {

            get { return lstName; }
            set { lstName = value; }
        }

        protected override void CreateChildControls()
        {
            //Control control = Page.LoadControl(_ascxPath);
            //Controls.Add(control);

            IR_StatusSummaryUserControl control =
            (IR_StatusSummaryUserControl)Page.LoadControl(_ascxPath);
            control.ParentWebPart = this;
            Controls.Add(control); 

        }
    }
}
